/*
 * @Author: zxh
 * @Date: 2024-07-26 14:18:27
 * @LastEditors: zxh
 * @LastEditTime: 2024-07-26 14:20:25
 * @Description: 请填写简介
 */
import { ref, computed } from 'vue'
// 导入一个方法 defineStore
import { defineStore } from 'pinia'
import { getCategoryAPI } from '@/apis/layout'

export const useCategoryStore = defineStore('category', () => {
  // 导航列表管理
  const categoryList = ref<any[]>([])
  const getCategory = async () => {
    const res = await getCategoryAPI()
    categoryList.value = res.result
  }

  return {
    categoryList,
    getCategory
  }
})
